<template lang="jade">
div
	h-loader-full(url='loader',:setdata='false')
		h-data-lister(data='list')
			m-title(icon='add',name='报名管理>报名列表')
			table.list
				ml-header(data='序号:5,学校名称:10,课程名称,课期名称, 报名人:10,报名人电话,报名类型,报名时间,取消时间')
				tr(v-for='(v, i) in list')
					td {{ v.id }}
					td {{v.sname}}
					td {{v.culname}}
					td {{v.semname}}
					td {{v.uname}}
					td {{v.umobile}}
					td(v-show='v.type=="user"') 用户
					td(v-show='v.type=="company"') 公司
					td {{new Date(v.apply_time*1000).format('yyyy-MM-dd hh:mm:ss')}}
					td(v-if='v.cancle_time != 0') {{new Date(v.cancle_time*1000).format('yyyy-MM-dd hh:mm:ss')}}
					td(v-else)
		.command
			.page
				button(@click="pagego('next')") 下一页
				button {{page}}
				button(v-show='page>1', @click="pagego('last')") 上一页
			
</template>

<script>
export default {
	data () {
		return {
			loader:{
				list: 'apply/list?status=' + this.$query.get('status'),
			},
			list: [],
			status:this.$query.get('status',0),
			page: 1,
		}
	},
	methods: {
		loadAfter (res) {
			this.list = res.list
		},
		// 分页
    pagego (type) {
      this.page = type == 'last' ? this.page - 1 : this.page + 1
      this.$ajax.get('apply/list?status=' + this.$query.get('status') + '&page=' + this.page, (res) => {
        this.list = res.data
      }, (res) => {
        this.error(res.message)
      })
    }
	}
}

</script>
<style lang="less" scoped>
@import "../../../plugin/style/mixin";
#mymap{ .bsol(#f0f0f0, 2); }
	div { overflow: visible;  }
	input{ .mr(10); border-radius: 5px;outline:none}
	button{ .fr;}
</style>
